[code]
public String getRunningActivityName(Context context) {
ActivityManager am = (ActivityManager) context
.getSystemService(android.content.Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningTaskInfo> taskInfo = am.getRunningTasks(1);
String[] activityFullName = taskInfo.get(0).topActivity.getClassName()
.split("\\.");
String currentActivity = activityFullName[activityFullName.length - 1];
return currentActivity;
}
public String getRunningActivityLongName(Context context) {
ActivityManager am = (ActivityManager) context
.getSystemService(android.content.Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningTaskInfo> taskInfo = am.getRunningTasks(1);
return taskInfo.get(0).topActivity.getClassName();
}
[/code]
aktif olan activitynin uzun ve kısa yolunu veren methodlar kullanabilirsin.